package cn.wd.model;

import cn.wd.common.enums.ResponseEnum;

/**
 * @author wangdong
 * @date 2024/9/13 15:38
 **/
public class ServiceException extends RuntimeException {

    private Integer code = ResponseEnum.FAIL.getCode();
    private String message;

    public ServiceException(String message) {
        this.message = message;
    }

    public ServiceException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public ServiceException(String message, Throwable e) {
        super(message, e);
        this.message = message;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    public Integer getCode() {
        return this.code;
    }
}
